home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
113_01
/
a68.doc
< prev
next >
Wrap
Text File
|
1985-03-09
|
36KB
|
1,315 lines
/*
HEADER: CUG113;
TITLE: 6800 Cross-Assembler (BDS C Version);
FILENAME: A68.DOC;
VERSION: 2.6;
DATE: 07/22/1985;
DESCRIPTION: "This program lets you use your CP/M-80-based computer
to assemble code for the Motorola 6800, 6801, 6802,
6803, 6808, and 68701 microprocessors. The program is
written in BDS C for the best possible performance on
8-bit machines. All assembler features are supported
except relocation, linkage, listing control, and
macros.";
KEYWORDS: Software Development, Assemblers, Cross-Assemblers,
Motorola, MC6800, MC6801;
SEE-ALSO: CUG149, 6801 Cross-Assembler (Portable);
SYSTEM: CP/M-80;
COMPILERS: BDS C;
WARNINGS: "This package is specifically tailored to CP/M-80
machines and the rather non-standard, but high-
performance BDS C compiler. For other environments,
use the portable version of this package on CUG149.";
AUTHORS: William C. Colley III;
*/
6800 Cross-assembler Rev. 2.6 Page 1
6800 Cross-assembler
Rev. 2.6
Copyright (c) 1980,83,84,85 William C. Colley, III
The Manual Such As It Is.
6800 Cross-assembler Rev. 2.6 Page 2
Index
1 Format of Cross-assembler Commands....................... 3
1.1 Command Strings..................................... 3
1.2 Options............................................. 3
1.3 Examples............................................ 3
2 Format of Cross-assembler Source Files................... 5
2.1 Statements......................................... 5
2.2 Symbols............................................ 5
2.3 Numeric Constants.................................. 6
2.4 Strings............................................ 6
3 Expression Evaluation.................................... 8
4 6800/6801 Instructions................................... 9
4.1 No Argument Group................................... 9
4.2 One Argument Group.................................. 9
4.3 Two Argument Group..................................10
4.4 Branch Group........................................10
4.5 Jump Group..........................................11
4.6 Stack Group.........................................11
4.7 Pointer Group.......................................11
4.8 On Direct-page Addressing...........................11
5 Pseudo-operations........................................13
5.1 END.................................................13
5.2 EQU.................................................13
5.3 FCB.................................................13
5.4 FCC.................................................13
5.5 FDB.................................................13
5.6 RMB.................................................14
5.7 Conditional Assembly................................14
5.8 ORG.................................................15
5.9 SET.................................................15
5.10 CPU.................................................15
6 Error Messages...........................................16
7 Assembler Abort Conditions...............................18
8 Compiling the Assembler..................................19
9 Final Comments...........................................21
6800 Cross-assembler Rev. 2.6 Page 3
1 Format of Cross-assembler Commands
1.1 Command Strings
To run the cross-assembler, type the following command line:
A>a68 filename options
filename: The name of the source input file is
filename.68h, the list can go to
filename.prn, and the hex file can go to
filename.hex.
options: See next section.
1.2 Options
The source file comes from the currently logged disk drive
unless it is redirected by putting the string "sd" in the
options field. s specifies the source file and d is a
device code from the following list:
a, b, c, d Disk drives.
- The currently logged in disk drive.
Lines of input containing errors will always be output to
the console device. If the full listing is desired, it must
be called for by putting the string "ld" in the options
field. l specifies list file and d is a device code as per
the source file, or one of the following:
x Console device.
y List device.
The hex file will not be output unless called for as per the
list file.
Options must be run together into a single string with no
embedded blanks.
1.3 Examples
A>a68 barf source -- a:barf.68h
list -- none.
hex -- none.
A>a68 barf sblxha source -- b:barf.68h
list -- con:
hex -- a:barf.hex
A>a68 barf ly source -- a:barf.68h
list -- lst:
hex -- none.
6800 Cross-assembler Rev. 2.6 Page 4
A>b:a68 barf sbh- source -- b:barf.68h
list -- none.
hex -- a:barf.hex
6800 Cross-assembler Rev. 2.6 Page 5
2 Format of Cross-assembler Source Files
Lines of source input are terminated with CR/LF pairs.
Internally, the character before the LF is discarded, so if
the CR is missing, the last character of the line will be
eaten up. The internal line buffer will hold a 120 charac-
ter line. This may be changed by altering the "#define
LINLEN 120" statement in a68.h and recompiling the cross-
assembler. Excess characters in the line are thrown out.
Lower case letters are converted to upper case in as few
places as possible. They are:
1) In opcodes,
2) In checking for keywords such as NOT, and
3) In command strings.
This means that "not", "NOT", "Not", etc. are all possible
spellings of the bitwise logical inversion operator. This
also means that "foo" and "FOO" are different symbols.
Watch this if you start encountering U errors of symbols
that you "know" you defined.
2.1 Statements
Source files input to the Cross-assembler consist of state-
ments of the form:
[label] [opcode] [arguments] [;comments.]
Labels are recognized by their beginning in column 1. If